#include "stdafx.h"
#include "POP2.h"

namespace POP2_TABLE
{
	enum SPECIAL_FLAGS
	{
		vampiric		= (1 << 0),
		powerful		= (1 << 1),
		indestructible	= (1 << 2),
		cursed			= (1 << 3),
		knockdown		= (1 << 4),
		powerthrow		= (1 << 5),
	};

	void ToRet(wxString& ret, const wxString& val)
	{
		ret += (!ret.IsEmpty() ? ", " : "") + val;
	}

	wxString SpecialToString(u32 spec)
	{
#define FLAG_TO_RET(x) if(spec & x) ToRet(ret, #x)

		wxString ret = wxEmptyString;

		FLAG_TO_RET(vampiric);
		FLAG_TO_RET(powerful);
		FLAG_TO_RET(indestructible);
		FLAG_TO_RET(cursed);
		FLAG_TO_RET(knockdown);
		FLAG_TO_RET(powerthrow);

		return ret;
	}

	//swords
	//01 - Buyasta
	ValueTableEntry m_buyasta_info[] =
	{
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(6),
		VALUE_ENTRY_PI(80),
	};

	//02 - Zarich
	ValueTableEntry m_zarich_info[] =
	{
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(80),
	};

	//03 - Haoma
	ValueTableEntry m_haoma_info[] =
	{
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(200),
	};

	//04 - Spenta
	ValueTableEntry m_spenta_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(80),
	};

	//05 - Yasht
	ValueTableEntry m_yasht_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(6),
		VALUE_ENTRY_PI(200),
	};

	//06 - Vanant
	ValueTableEntry m_vanant_info[] =
	{
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(80),
	};

	//07 - Kerena
	ValueTableEntry m_kerena_info[] =
	{
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(60),
		VALUE_ENTRY_PI(powerful),
	};

	//08 - Camros
	ValueTableEntry m_camros_info[] =
	{
		VALUE_ENTRY_PI(6),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(80),
		VALUE_ENTRY_PI(cursed),
	};

	//09 - Fravashis
	ValueTableEntry m_fravashis_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(200),
		VALUE_ENTRY_PI(cursed),
	};

	//10 - Tasan
	ValueTableEntry m_tasan_info[] =
	{
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(90),
		VALUE_ENTRY_PI(vampiric),
	};

	//11 - Asto
	ValueTableEntry m_asto_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(60),
		VALUE_ENTRY_PI(vampiric),
	};

	//12 - Agas
	ValueTableEntry m_agas_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(120),
		VALUE_ENTRY_PI(vampiric),
	};

	//13 - Shosh
	ValueTableEntry m_srosh_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(indestructible),
	};

	//14 - Rustam
	ValueTableEntry m_rustam_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(120),
	};

	//15 - Mainyu (Sword, 3300E645)
	ValueTableEntry m_mainyu_3300E645_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(100),
	};

	//16 - Mahre
	ValueTableEntry m_mahre_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(200),
	};

	//17 - Dena
	ValueTableEntry m_dena_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(6),
		VALUE_ENTRY_PI(60),
		VALUE_ENTRY_PI(vampiric),
	};

	//18 - Asman
	ValueTableEntry m_asman_info[] =
	{
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(30),
		VALUE_ENTRY_PI(powerful),
	};

	MainTableEntry m_swords_info_list[] =
	{
		MAIN_ENTRY_PL(m_buyasta_info),
		MAIN_ENTRY_PL(m_zarich_info),
		MAIN_ENTRY_PL(m_haoma_info),
		MAIN_ENTRY_PL(m_spenta_info),
		MAIN_ENTRY_PL(m_yasht_info),
		MAIN_ENTRY_PL(m_vanant_info),
		MAIN_ENTRY_PL(m_kerena_info),
		MAIN_ENTRY_PL(m_camros_info),
		MAIN_ENTRY_PL(m_fravashis_info),
		MAIN_ENTRY_PL(m_tasan_info),
		MAIN_ENTRY_PL(m_asto_info),
		MAIN_ENTRY_PL(m_agas_info),
		MAIN_ENTRY_PL(m_srosh_info),
		MAIN_ENTRY_PL(m_rustam_info),
		MAIN_ENTRY_PL(m_mainyu_3300E645_info),
		MAIN_ENTRY_PL(m_mahre_info),
		MAIN_ENTRY_PL(m_dena_info),
		MAIN_ENTRY_PL(m_asman_info),
	};

	//axes
	//01 - Airyaman
	ValueTableEntry m_airyaman_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(60),
	};

	//02 - Allatum
	ValueTableEntry m_allatum_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(60),
	};

	//03 - Natat
	ValueTableEntry m_natat_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(60),
	};

	//04 - Apaosa
	ValueTableEntry m_apaosa_info[] =
	{
		VALUE_ENTRY_PI(6),
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(30),
		VALUE_ENTRY_PI(powerthrow),
	};

	//05 - Vahishta (Axe)
	ValueTableEntry m_vahishta_3300E590_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(100),
	};

	//06 - Vidatu
	ValueTableEntry m_vidatu_info[] =
	{
		VALUE_ENTRY_PI(6),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(60),
	};

	//07 - Ahura#1 (Axe)
	ValueTableEntry m_ahura_13013843_info[] =
	{
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(60),
	};

	//08 - Drvaspa
	ValueTableEntry m_drvaspa_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(60),
	};

	//09 - Apam
	ValueTableEntry m_apam_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(60),
	};

	//10 - Ereta
	ValueTableEntry m_ereta_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(6),
		VALUE_ENTRY_PI(60),
	};

	//11 - Mainyu (Axe)
	ValueTableEntry m_mainyu_13015B30_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(6),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(150),
	};

	//12 - Ahura#2 (Axe)
	ValueTableEntry m_ahura_3300E593_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(60),
		VALUE_ENTRY_PI(knockdown),
	};

	//13 - Bahram
	ValueTableEntry m_bahram_info[] =
	{
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(30),
		VALUE_ENTRY_PI(powerful),
	};

	//14 - Spentas
	ValueTableEntry m_spentas_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(indestructible | cursed),
	};

	MainTableEntry m_axes_info_list[] =
	{
		MAIN_ENTRY_PL(m_airyaman_info),
		MAIN_ENTRY_PL(m_allatum_info),
		MAIN_ENTRY_PL(m_natat_info),
		MAIN_ENTRY_PL(m_apaosa_info),
		MAIN_ENTRY_PL(m_vahishta_3300E590_info),
		MAIN_ENTRY_PL(m_vidatu_info),
		MAIN_ENTRY_PL(m_ahura_13013843_info),
		MAIN_ENTRY_PL(m_drvaspa_info),
		MAIN_ENTRY_PL(m_apam_info),
		MAIN_ENTRY_PL(m_ereta_info),
		MAIN_ENTRY_PL(m_mainyu_13015B30_info),
		MAIN_ENTRY_PL(m_ahura_3300E593_info),
		MAIN_ENTRY_PL(m_bahram_info),
		MAIN_ENTRY_PL(m_spentas_info),
	};

	//maces
	//01 - Peris
	ValueTableEntry m_peris_info[] =
	{
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(100),
	};

	//02 - Zend
	ValueTableEntry m_zend_info[] =
	{
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(120),
	};

	//03 - Vata
	ValueTableEntry m_vata_info[] =
	{
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(200),
	};

	//04 - Sraosa
	ValueTableEntry m_sraosa_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(80),
		VALUE_ENTRY_PI(knockdown),
	};

	//05 - Menog
	ValueTableEntry m_menog_info[] =
	{
		VALUE_ENTRY_PI(6),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(knockdown),
	};

	//06 - Baga
	ValueTableEntry m_baga_info[] =
	{
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(120),
	};

	//07 - Yima
	ValueTableEntry m_yima_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(80),
	};

	//08 - Izha
	ValueTableEntry m_izha_info[] =
	{
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(300),
		VALUE_ENTRY_PI(knockdown),
	};

	MainTableEntry m_maces_info_list[] =
	{
		MAIN_ENTRY_PL(m_peris_info),
		MAIN_ENTRY_PL(m_zend_info),
		MAIN_ENTRY_PL(m_vata_info),
		MAIN_ENTRY_PL(m_sraosa_info),
		MAIN_ENTRY_PL(m_menog_info),
		MAIN_ENTRY_PL(m_baga_info),
		MAIN_ENTRY_PL(m_yima_info),
		MAIN_ENTRY_PL(m_izha_info),
	};


	//daggers
	//01 - Khara
	ValueTableEntry m_khara_info[] =
	{
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(60),
		VALUE_ENTRY_PI(powerthrow),
	};

	//02 - Indra
	ValueTableEntry m_indra_info[] =
	{
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(80),
		VALUE_ENTRY_PI(powerthrow),
	};

	//03 - Abathur
	ValueTableEntry m_abathur_info[] =
	{
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(powerthrow),
	};

	//04 - Armaiti
	ValueTableEntry m_armaiti_info[] =
	{
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(60),
	};

	//05 - Yazata
	ValueTableEntry m_yazata_info[] =
	{
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(powerthrow),
	};

	//06 - Vahishta (Dagger)
	ValueTableEntry m_vahishta_3300E63F_info[] =
	{
		VALUE_ENTRY_PI(6),
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(120),
	};

	MainTableEntry m_daggers_info_list[] =
	{
		MAIN_ENTRY_PL(m_khara_info),
		MAIN_ENTRY_PL(m_indra_info),
		MAIN_ENTRY_PL(m_abathur_info),
		MAIN_ENTRY_PL(m_armaiti_info),
		MAIN_ENTRY_PL(m_yazata_info),
		MAIN_ENTRY_PL(m_vahishta_3300E63F_info),
	};

	//secrets
	//01 - Teddy Bear
	ValueTableEntry m_teddy_bear_info[] =
	{
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(5),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(indestructible | vampiric),
	};

	//02 - Rayman Fist
	ValueTableEntry m_rayman_fist_info[] =
	{
		VALUE_ENTRY_PI(2),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(7),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(indestructible | knockdown),
	};

	//03 - Pink Flamingo
	ValueTableEntry m_pink_flamingo_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(1),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(indestructible | knockdown),
	};

	//04 - Hockey Stick
	ValueTableEntry m_hockey_stick_info[] =
	{
		VALUE_ENTRY_PI(4),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(3),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(indestructible | powerful),
	};

	//05 - Light Sword
	ValueTableEntry m_light_sword_info[] =
	{
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(8),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(indestructible | cursed),
	};

	MainTableEntry m_secrets_info_list[] =
	{
		MAIN_ENTRY_PL(m_teddy_bear_info),
		MAIN_ENTRY_PL(m_rayman_fist_info),
		MAIN_ENTRY_PL(m_pink_flamingo_info),
		MAIN_ENTRY_PL(m_hockey_stick_info),
		MAIN_ENTRY_PL(m_light_sword_info),
	};

	//undocumented
	//01 - Mace???
	ValueTableEntry m_mace_3300E64D_info[] =
	{
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0),
	};

	//02 - Mace???
	ValueTableEntry m_mace_3300E640_info[] =
	{
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0),
	};

	//03 - Shahdee's Sword
	ValueTableEntry m_shahdees_sword_info[] =
	{
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0), //100? looks like all indestructible weapons have "100" value
		VALUE_ENTRY_PI(indestructible | cursed),
	};

	//04 - Kaileena's Sword
	ValueTableEntry m_kaileenas_sword_info[] =
	{
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0),
		VALUE_ENTRY_PI(0), //100? looks like all indestructible weapons have "100" value
		VALUE_ENTRY_PI(indestructible | cursed),
	};

	MainTableEntry m_undocumented_info_list[] =
	{
		MAIN_ENTRY_PL(m_mace_3300E64D_info),
		MAIN_ENTRY_PL(m_mace_3300E640_info),
		MAIN_ENTRY_PL(m_shahdees_sword_info),
		MAIN_ENTRY_PL(m_kaileenas_sword_info),
	};

	ValueTableEntry m_sec_weapon_proto[] =
	{
		VALUE_ENTRY_PN("Attack Power: %id"),
		VALUE_ENTRY_PN("Block Endurance: %id"),
		VALUE_ENTRY_PN("Attack Speed: %id"),
		VALUE_ENTRY_PN("Durabity: %id"),
		VALUE_ENTRY_PNF("Special: %func", SpecialToString),
	};

	MainTableEntry m_sec_weapon_info[] =
	{
		MAIN_ENTRY_I(m_swords_info_list),
		MAIN_ENTRY_I(m_axes_info_list),
		MAIN_ENTRY_I(m_maces_info_list),
		MAIN_ENTRY_I(m_daggers_info_list),
		MAIN_ENTRY_I(m_secrets_info_list),
		MAIN_ENTRY_I(m_undocumented_info_list),
	};

	ValueTableEntry m_swords_list[] =
	{
		VALUE_ENTRY_R(0x160010DB, "[%idh] Buyasta"),
		VALUE_ENTRY_R(0x3300E64E, "[%idh] Zarich"),
		VALUE_ENTRY_R(0x3300E64A, "[%idh] Haoma"),
		VALUE_ENTRY_R(0x3300E64B, "[%idh] Spenta"),
		VALUE_ENTRY_R(0x13015B3C, "[%idh] Yasht"),
		VALUE_ENTRY_R(0x160010DD, "[%idh] Vanant"),
		VALUE_ENTRY_R(0x3300E63C, "[%idh] Kerena"),
		VALUE_ENTRY_R(0x13015B3E, "[%idh] Camros"),
		VALUE_ENTRY_R(0x3300E651, "[%idh] Fravashis"),
		VALUE_ENTRY_R(0x3300E649, "[%idh] Tasan"),
		VALUE_ENTRY_R(0x3300E643, "[%idh] Asto"),
		VALUE_ENTRY_R(0x3300E648, "[%idh] Agas"),
		VALUE_ENTRY_R(0x13015B40, "[%idh] Srosh"),
		VALUE_ENTRY_R(0x3300E64C, "[%idh] Rustam"),
		VALUE_ENTRY_R(0x3300E645, "[%idh] Mainyu"),
		VALUE_ENTRY_R(0x13015B38, "[%idh] Mahre"),
		VALUE_ENTRY_R(0x3A5B0113, "[%idh] Dena"),
		VALUE_ENTRY_R(0x3300E647, "[%idh] Asman"),
	};

	ValueTableEntry m_axes_list[] =
	{
		VALUE_ENTRY_R(0x3300E583, "[%idh] Airyaman"),
		VALUE_ENTRY_R(0x160010DF, "[%idh] Allatum"),
		VALUE_ENTRY_R(0x3300E572, "[%idh] Natat"),
		VALUE_ENTRY_R(0x3300E591, "[%idh] Apaosa"),
		VALUE_ENTRY_R(0x3300E590, "[%idh] Vahishta"),
		VALUE_ENTRY_R(0x3300E579, "[%idh] Vidatu"),
		VALUE_ENTRY_R(0x13013843, "[%idh] Ahura"),
		VALUE_ENTRY_R(0x3300E63D, "[%idh] Drvaspa"),
		VALUE_ENTRY_R(0x3300E562, "[%idh] Apam"),
		VALUE_ENTRY_R(0x3300E578, "[%idh] Ereta"),
		VALUE_ENTRY_R(0x13015B30, "[%idh] Mainyu"),
		VALUE_ENTRY_R(0x3300E593, "[%idh] Ahura"),
		VALUE_ENTRY_R(0x3300E57B, "[%idh] Bahram"),
		VALUE_ENTRY_R(0x3300E592, "[%idh] Spentas"),
	};

	ValueTableEntry m_maces_list[] =
	{
		VALUE_ENTRY_R(0x3300E63A, "[%idh] Peris"),
		VALUE_ENTRY_R(0x3300E650, "[%idh] Zend"),
		VALUE_ENTRY_R(0x3300E646, "[%idh] Vata"),
		VALUE_ENTRY_R(0x3300E64F, "[%idh] Sraosa"),
		VALUE_ENTRY_R(0x13015B8F, "[%idh] Menog"),
		VALUE_ENTRY_R(0x1301381A, "[%idh] Baga"),
		VALUE_ENTRY_R(0x3300E644, "[%idh] Yima"),
		VALUE_ENTRY_R(0x3300E639, "[%idh] Izha"),
	};

	ValueTableEntry m_daggers_list[] =
	{
		VALUE_ENTRY_R(0x13015B32, "[%idh] Khara"),
		VALUE_ENTRY_R(0x13015B34, "[%idh] Indra"),
		VALUE_ENTRY_R(0x3300E636, "[%idh] Abathur"),
		VALUE_ENTRY_R(0x3300E63B, "[%idh] Armaiti"),
		VALUE_ENTRY_R(0x3300E637, "[%idh] Yazata"),
		VALUE_ENTRY_R(0x3300E63F, "[%idh] Vahishta"),
	};

	ValueTableEntry m_secrets_list[] =
	{
		VALUE_ENTRY_R(0x3300E63E, "[%idh] Teddy Bear"),
		VALUE_ENTRY_R(0x3300E635, "[%idh] Rayman Fist"),
		VALUE_ENTRY_R(0x3300E642, "[%idh] Pink Flamingo"),
		VALUE_ENTRY_R(0x3300E638, "[%idh] Hockey Stick"),
		VALUE_ENTRY_R(0x3300E641, "[%idh] Light Sword"),
	};

	ValueTableEntry m_undocumented_list[] =
	{
		VALUE_ENTRY_R(0x3300E64D, "[%idh] Mace"),
		VALUE_ENTRY_R(0x3300E640, "[%idh] Mace"),
		VALUE_ENTRY_R(0x3300E633, "[%idh] Shahdee's Sword"),
		VALUE_ENTRY_R(0x3300E631, "[%idh] Kaileena's Sword"),
	};

	ValueTableEntry m_sec_weapon_list[] =
	{
		VALUE_ENTRY_IC("Swords", m_swords_list),
		VALUE_ENTRY_IC("Axes", m_axes_list),
		VALUE_ENTRY_IC("Maces", m_maces_list),
		VALUE_ENTRY_IC("Daggers", m_daggers_list),
		VALUE_ENTRY_IC("Secrets", m_secrets_list),
		VALUE_ENTRY_IC("Undocumented", m_undocumented_list),
	};

	//player info 1
	ValueTableEntry m_difficulty_list[] =
	{
		VALUE_ENTRY_R(0, "Easy"),
		VALUE_ENTRY_R(1, "Normal"),
		VALUE_ENTRY_R(2, "Hard"),
	};

	ValueTableEntry m_prim_weapon_list[] =
	{
		VALUE_ENTRY_R(0, "Eagle Sword"),
		VALUE_ENTRY_R(1, "Wooden Stick"),
		VALUE_ENTRY_R(2, "Spider Sword"),
		VALUE_ENTRY_R(3, "Serpent Sword"),
		VALUE_ENTRY_R(4, "Lion Sword"),
		VALUE_ENTRY_R(5, "Lion Sword (broken)"),
		VALUE_ENTRY_R(6, "Scorpion Sword"),
		VALUE_ENTRY_R(7, "Water Sword"),
	};

	ValueTableEntry m_sand_powers_tanks_list[] =
	{
		VALUE_ENTRY_R(0, "None"),
		VALUE_ENTRY_R(1, "Recall"),
		VALUE_ENTRY_R(2, "Eye of the Storm"),
		VALUE_ENTRY_R(3, "Breath of Fate"),
		VALUE_ENTRY_R(4, "4 Sand Tanks"),
		VALUE_ENTRY_R(5, "Ravages of Time"),
		VALUE_ENTRY_R(6, "5 Sand Tanks"),
		VALUE_ENTRY_R(7, "Wind of Fate"),
		VALUE_ENTRY_R(8, "6 Sand Tanks"),
		VALUE_ENTRY_R(9, "Cyclone of Fate"),
	};

	ValueTableEntry m_char_hack_list[] = //modification required!!!
	{
		VALUE_ENTRY_R(0, "No"), //if data in both offsets is same (0x2C == 0xBC38), else
		VALUE_ENTRY_R(0x3B0056B8, "Yes (Prince)"),
		VALUE_ENTRY_R(0x3B00EF64, "Yes (Sand Wraith)"),
	};

	ValueTableEntry m_health_list_easy[] =
	{
		VALUE_ENTRY_PI(150),
		VALUE_ENTRY_PI(176),
		VALUE_ENTRY_PI(201),
		VALUE_ENTRY_PI(226),
		VALUE_ENTRY_PI(250),
		VALUE_ENTRY_PI(276),
		VALUE_ENTRY_PI(301),
		VALUE_ENTRY_PI(326),
		VALUE_ENTRY_PI(351),
		VALUE_ENTRY_PI(376),
	};

	ValueTableEntry m_health_list_normal[] =
	{
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(117),
		VALUE_ENTRY_PI(134),
		VALUE_ENTRY_PI(151),
		VALUE_ENTRY_PI(167),
		VALUE_ENTRY_PI(184),
		VALUE_ENTRY_PI(201),
		VALUE_ENTRY_PI(217),
		VALUE_ENTRY_PI(234),
		VALUE_ENTRY_PI(251),
	};

	ValueTableEntry m_health_list_hard[] =
	{
		VALUE_ENTRY_PI(66),
		VALUE_ENTRY_PI(78),
		VALUE_ENTRY_PI(89),
		VALUE_ENTRY_PI(100),
		VALUE_ENTRY_PI(111),
		VALUE_ENTRY_PI(122),
		VALUE_ENTRY_PI(133),
		VALUE_ENTRY_PI(144),
		VALUE_ENTRY_PI(155),
		VALUE_ENTRY_PI(166),
	};

	MainTableEntry m_health_list[] =
	{
		MAIN_ENTRY_PLC(m_health_list_easy),
		MAIN_ENTRY_PLC(m_health_list_normal),
		MAIN_ENTRY_PLC(m_health_list_hard),
	};

	ValueTableEntry m_health_proto[] =
	{
		VALUE_ENTRY_PN("%num life upgrades (%id)"),
	};

	MainTableEntry m_player_info_table[] =
	{
		//player info 1
		MAIN_ENTRY_LI("Secondary Weapon",				0x0024, sizeof(u32), m_sec_weapon_list, m_sec_weapon_info, m_sec_weapon_proto),
		MAIN_ENTRY_L("Character Hack",					0x002C, sizeof(u32), m_char_hack_list, | TYPE_CONST),
		//game info
		MAIN_ENTRY_LC("Difficulty",						0x0078, sizeof(u8 ), m_difficulty_list, m_player_info_table[4], CONNECT_BY_SEL),
		//player info 2
		MAIN_ENTRY_R("Current health",					0xBC18, sizeof(u16), TYPE_VALUE | TYPE_MIN_I, 0),
		MAIN_ENTRY_P("Max health",						0xBC1A, sizeof(u16), m_health_list, m_health_proto),
		MAIN_ENTRY_R("Filled Sand Tanks",				0xBC1C, sizeof(u16), TYPE_VALUE_RANGE_I_I, 0, 6),
		MAIN_ENTRY_L("Unlocked Sand Powers/Tanks",		0xBC1E, sizeof(u16), m_sand_powers_tanks_list),
		MAIN_ENTRY_R("Unk",								0xBC20, sizeof(u16), TYPE_VALUE),
		MAIN_ENTRY_R("CurSecWpn Durabity",				0xBC22, sizeof(u16), TYPE_VALUE | TYPE_MIN_I, 0),
		MAIN_ENTRY_L("Primary Weapon",					0xBC24, sizeof(u32), m_prim_weapon_list),
	};

	TableListEntry m_table_list[] =
	{
		LIST_ENTRY_R(m_player_info_table),
	};

	MainTableEntry m_trainer_player_info_table[] =
	{
		//TODO
		//player info 1
		MAIN_ENTRY_LI("Secondary Weapon",				0, sizeof(u32), m_sec_weapon_list, m_sec_weapon_info, m_sec_weapon_proto),
		MAIN_ENTRY_L("Character Hack",					0, sizeof(u32), m_char_hack_list, | TYPE_CONST),
		//game info
		MAIN_ENTRY_LC("Difficulty",						0, sizeof(u8 ), m_difficulty_list, m_player_info_table[4], CONNECT_BY_SEL),
		//player info 2
		MAIN_ENTRY_R("Current health",					0, sizeof(u16), TYPE_VALUE | TYPE_MIN_I, 0),
		MAIN_ENTRY_P("Max health",						0, sizeof(u16), m_health_list, m_health_proto),
		MAIN_ENTRY_R("Filled Sand Tanks",				0, sizeof(u16), TYPE_VALUE_RANGE_I_I, 0, 6),
		MAIN_ENTRY_L("Unlocked Sand Powers/Tanks",		0, sizeof(u16), m_sand_powers_tanks_list),
		//MAIN_ENTRY_R("Unk",								0, sizeof(u16), TYPE_VALUE),
		MAIN_ENTRY_R("CurSecWpn Durabity",				0, sizeof(u16), TYPE_VALUE | TYPE_MIN_I, 0),
		MAIN_ENTRY_L("Primary Weapon",					0, sizeof(u32), m_prim_weapon_list),
	};

	TableListEntry m_trainer_table_list[] =
	{
		LIST_ENTRY_R(m_trainer_player_info_table),
	};
}

POP2::POP2() : FileTableGUI()
{
}

bool POP2::Test(const wxString& path)
{
	Init(POP2_TABLE::m_table_list, WXSIZEOF(POP2_TABLE::m_table_list));

	return wxFileName(path).GetFullName().CmpNoCase("PSPPOP.BIN") == 0;
}

TrainerPOP2::TrainerPOP2() : ProcessTableGUI()
{
}

bool TrainerPOP2::Test(const wxString& process)
{
	Init(POP2_TABLE::m_trainer_table_list, WXSIZEOF(POP2_TABLE::m_trainer_table_list));

	return process.CmpNoCase("POP2.EXE") == 0;
}